﻿using Glue.Converters;
using Xunit;

namespace GlueTests.Converters
{
    namespace IfNotZeroConverterTest
    {
        public class When_converting
        {
            private readonly IfNotZeroConverter converter;

            public When_converting()
            {
                converter = new IfNotZeroConverter();
            }

            [Fact]
            public void Should_return_original_value_if_new_value_is_zero()
            {
                Assert.Equal(5,converter.MapTowardsLeft(0, 5));
                Assert.Equal(6, converter.MapTowardsRight(0, 6));
            }

            [Fact]
            public void Should_map_if_input_is_not_zero()
            {
                Assert.Equal(4, converter.MapTowardsLeft(4, 5));
                Assert.Equal(3, converter.MapTowardsRight(3, 6));
            }
        }
    }
}
